<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="imports.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" media="screen" type="text/css" title="style"
	href="style.css" />
<title>Mon compte</title>
</head>
<body>



	
		<c:choose>
						<c:when  test="${sessionUser == null && user==null}">
							<jsp:forward page="/m" />
						</c:when>
						<c:when  test="${sessionUser!=null && user==null}">
							<c:set scope="page" var="user" value="${sessionUser}" />
						</c:when>
							
						<c:otherwise>	
						</c:otherwise>
		</c:choose>
	
	
		
	
	<div id="wrapper">
		<div id="header">
			<div id="logo">
				<h1>e-commerce de livres</h1>


			</div>

		</div>
		<!-- end #header -->
		<div id="menu">
			<jsp:include page="header.jsp" />
		</div>
		<!-- end #menu -->
		<div id="page">
			<div id="page-bgtop">
				<div id="page-bgbtm">


					<div id="content">

						<div class="post">
							<h2 class="title">Modification de compte</h2>
							<div class="entry">





								<form method="post" action="account">
									<fieldset>
										<legend>Identification du compte</legend>
										<table>
											<tr>
												<td><label for="username">Nom d'utilisateur : </label>
												</td>
												<td><input type="text" name="username" id="username"
													size="30" maxlength="40" value="${user.username}"
													disabled="disabled" /></td>
											</tr>
											<tr>
												<td><label for="username">Nouveau mot de passe
														: </label></td>
												<td><input type="password" name="password"
													id="password" size="30" maxlength="40"
													value="${user.password}" /></td>
											</tr>
											<c:choose>
						<c:when  test="${sessionUser.role == 'ADMIN'}">
							<tr>
												<td>Rôle :</td>
												<td>
											
												<input type="radio" name="role" value="admin" id="admin"
												<c:if test="${user.role == 'ADMIN'}">
												checked="checked"
												</c:if>/> 
												 <label for="admin">Administrateur</label> 
												<input type="radio" name="role" value="client" id="client"	
												<c:if test="${user.role == 'CLIENT'}">
												checked="checked"
												</c:if> /> 
												 
												<label for="client">Client</label></td>
											
											</tr>
						</c:when>
						<c:otherwise>
						
							<input type="hidden" name="role" value="${user.role}">
							
						</c:otherwise>
					</c:choose>
										
										</table>
									</fieldset>
									<br />

									<fieldset>
										<legend>Vos coordonnées</legend>
										<table>
											<tr>
												<td><label for="lastname">Nom : </label></td>
												<td><input type="text" name="lastname" id="lastname"
													size="30" maxlength="40" value="${user.lastname}" />
												</td>
											</tr>
											<tr>
												<td><label for="firstname">Prénom : </label></td>
												<td><input type="text" name="firstname" id="firstname"
													size="30" maxlength="40" value="${user.firstname}" />
												</td>
											<tr>
											<tr>
												<td><label for="email">E-mail : </label></td>
												<td><input type="text" name="email" id="email"
													size="30" maxlength="200" value="${user.email}" /></td>
											<tr>
											<tr>
												<td><label for="address">Adresse : </label></td>
												<td><input type="text" name="address" id="address"
													size="30" maxlength="200" value="${user.address}" />
												</td>
											<tr>
											<tr>
												<td><label for="city">Ville : </label></td>
												<td><input type="text" name="city" id="city" size="30"
													maxlength="40" value="${user.city}" /></td>
											<tr>
											<tr>
												<td><label for="postcode">Code postal : </label></td>
												<td><input type="text" name="postcode" id="postcode"
													size="8" maxlength="8" value="${user.postcode}" />
												</td>
											<tr>
										</table>
									</fieldset>
									<input type="hidden" name="id" value="${user.id}">
									<input type="submit" value="Enregistrer les modifications" />
								</form>


							</div>


						</div>

						<div style="clear: both;">&nbsp;</div>
					</div>
					<!-- end #content -->
					<div id="sidebar">
						<ul>
							<jsp:include page="admin.jsp" />
							
							<jsp:include page="categories.jsp" />
				

						</ul>
					</div>
					<!-- end #sidebar -->
					<div style="clear: both;">&nbsp;</div>
				</div>
			</div>
		</div>
		<!-- end #page -->
	</div>
	<div id="footer">
		<p>Copyright (c) 2011. All rights reserved.</p>
	</div>
	<!-- end #footer -->
</body>
</html>



